package ThreadPoolCheck.RuleIssue;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

/**
 * Created by wangyg6 on 2017/11/7.
 */
public class FirstFloor implements Callable<String> {
	public String prefix;
	private static ExecutorService exe;

	static {
		exe = Executors.newFixedThreadPool(10);
	}

	public FirstFloor(String prefix) {
		this.prefix = prefix;
	}

	@Override
	public String call() throws Exception {
		//		Thread.sleep((long) Math.random()*FinalConst.BASIC_SLEEP_TIME);
		for (int i = 1; i < 10; i++) {
			FutureTask<String> futureTask = new FutureTask<String>(new SecondFloor(prefix, i));
			exe.submit(futureTask);
		}

		return null;
	}
}
